Skip to content

Issue #30: Replace Psalm with PHPStan#31

Merged
alexmerlin merged 5 commits intodotkernel:3.0from
Howriq:issue-#30
Mar 11, 2025
Merged

Issue #30: Replace Psalm with PHPStan#31
alexmerlin merged 5 commits intodotkernel:3.0from
Howriq:issue-#30

Conversation

@Howriq
Copy link
Member

@Howriq Howriq commented Mar 6, 2025

No description provided.

@Howriq Howriq requested a review from alexmerlin March 6, 2025 15:04
@Howriq Howriq linked an issue Mar 6, 2025 that may be closed by this pull request
@alexmerlin
Copy link
Member

@arhimede
There are some conflicts between
dot-rbac's src/Assertion/AssertionPluginManager.php using PHPStan
and
vendor/laminas/laminas-servicemanager/src/AbstractPluginManager.php using Psalm.
https://github.com/dotkernel/dot-rbac/actions/runs/13701731048/job/38317054210?pr=31

Should we push forward implementing PHPStan on branch 3.0 (using SM3) once there is branch 4.0 (using SM4)?
If yes, then we will probably have to suppress these errors reported by PHPStan.

Note

This PR was created from branch 3.0 because branch 4.0 is not yet set as default.
3.0 is default one because 4.0 has not been tested yet using a real project, since there is not project with dot-rbac that supports SM4.

@arhimede
Copy link
Member

arhimede commented Mar 7, 2025

@arhimede There are some conflicts between dot-rbac's src/Assertion/AssertionPluginManager.php using PHPStan and vendor/laminas/laminas-servicemanager/src/AbstractPluginManager.php using Psalm. https://github.com/dotkernel/dot-rbac/actions/runs/13701731048/job/38317054210?pr=31

Should we push forward implementing PHPStan on branch 3.0 (using SM3) once there is branch 4.0 (using SM4)? If yes, then we will probably have to suppress these errors reported by PHPStan.

Note

This PR was created from branch 3.0 because branch 4.0 is not yet set as default. 3.0 is default one because 4.0 has not been tested yet using a real project, since there is not project with dot-rbac that supports SM4.

Let's modify the branch 3.0 to use phpstan
and do the same-ish PR to branch 4.0

Copy link
Member

@alexmerlin alexmerlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Replace all occurrences of DotKernel with Dotkernel.

  1. In src/Assertion/AssertionPluginManager.php replace:
/** @var string  */
protected $instanceOf = AssertionInterface::class;

with

/** @var null|class-string<AssertionInterface> $instanceOf */
protected $instanceOf = AssertionInterface::class;

  1. In src/Role/Provider/RoleProviderPluginManager.php replace:
/** @var string  */
protected $instanceOf = RoleProviderInterface::class;

with

/** @var null|class-string<RoleProviderInterface> $instanceOf */
protected $instanceOf = RoleProviderInterface::class;

  1. Add to phpstan.neon's ignoreErrors the 3 errors reported by PHPStan.

Signed-off-by: horea <horea@rospace.com>
@Howriq Howriq requested a review from alexmerlin March 10, 2025 14:40
@alexmerlin alexmerlin merged commit 378b184 into dotkernel:3.0 Mar 11, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace Psalm with PHPStan (branch 3.0)

3 participants